package com.fa4j.code.mate.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Map;

/**
 * 代码元数据
 *
 * @since 2025-09-14 11:40:42
 */
@Data
@TableName(value = "t_code_mate", autoResultMap = true)
@Schema(description = "代码元数据")
public class CodeMate extends AbstractCodeMate {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "类型")
    private CodeMateType type;

    @Schema(description = "元数据", hidden = true)
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private Map<String, Object> data;

}
